package jay;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

public class JWTDemo1 {
    public static void main(String[] args) {
        String secretKey = "mayiktKey";
        JwtBuilder jwtBuilder = Jwts.builder()
                .setId("66")
                .setSubject("mayikt")
                .setIssuedAt(new Date())
                .claim("username","jielin")
                .signWith(SignatureAlgorithm.HS256,secretKey);
        System.out.println(jwtBuilder.compact());
    }
}
